//
// Created by 123 on 2025/1/6.
//
#include "iostream"
using namespace std;

template<class T1, class T2>
class Person{
public:
    //成员函数类声明
    Person(T1 name,T2 age);
    void showPerson();
public:
    T1 name;
    T2 age;
};
//构造函数类外实现
template<class T1,class T2>
Person<T1,T2> ::Person(T1 name, T2 age) {
    this->name = name;
    this->age = age;
}

//成员函数类外实现
template<class T1,class T2>
void Person<T1,T2>::showPerson() {
    cout << "name:" << this->name << " age:" << this->age << endl;
}

void test1(){
    Person<string,int> p("tom",20);
    p.showPerson();
}

int main105(){
    test1();


    return 0;
}